package com.kitchen
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;

	public class AbstractIcon extends Bitmap
	{
		public var h:Number;
		public var w:Number;
		
		public function AbstractIcon(bitmapData:BitmapData)
		{
			var bitdata:BitmapData = this.cutRec(bitmapData);
			super(bitdata, 'auto', false);
		}
		
		protected function cutRec(bitmapData:BitmapData):BitmapData{
			throw new Error('you must override this function in child class.');
			return null;
		}
		
		/**
		 * 克隆(避免重复的bitmapdata的copypixes)
		 **/
		public function clone():Bitmap{
			return new Bitmap(this.bitmapData);
		}
	}
}